package org.example.order.feign.fallback;

import org.example.order.feign.ProductFeignClient;
import org.example.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @Author : wer
 * @Date: 2025/6/22 12:30
 * @Description: 产品服务的Feign客服端回调
 */

@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    
    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调触发......");
        Product product = new Product();
        product.setId(id);
        product.setProductName("未知商品");
        product.setPrice(new BigDecimal(0));
        product.setNum(0);
        return product;
    }
}
